package classTest_03.dao.impl;

import classTest_03.dao.Buyer;

public class IntermediaryImpl implements Buyer {

    /**
     * 被代理的目标对象
     */
    private  Buyer target;

    public  IntermediaryImpl(Buyer target){
        this.target=target;
    }

    /**
     * 对目标对象业务进行代理
     * @return
     */
    @Override
    public String havealook() {
        before();
        String feedback = target.havealook();//执行目标对象的实际业务
        after();
        return "看房记录：卖家反馈“"+feedback+"”";
    }
    public void before(){
        System.out.println("前期准备。");
        System.out.println("查找房源。");
        System.out.println("和卖家沟通时间。");
    }
    public void after(){
        System.out.println("后期跟踪");
        System.out.println("和买家沟通意见。");
    }
}
